package com.bjpowernode.springboot.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.HashMap;

@Controller
@RequestMapping(value = "/index")
public class IndexController {

    @RequestMapping(value = "hello")
    @ResponseBody
    public String hello() {
        return "hello, springboot";
    }

    @RequestMapping(value = "map")
    @ResponseBody // 该注解自动将map-->json
    public HashMap<String, Object> map() {
        HashMap<String, Object> map = new HashMap<>();
        map.put("message","SpringBoot Project");
        return map;
    }
}
